package com.jwork.progress.controllers;

import com.jwork.progress.config.annotation.SystemLog;
import com.jwork.progress.params.CommonResponse;
import com.jwork.progress.pojo.dto.calculator.GetCalResDTO;
import com.jwork.progress.pojo.vo.calculator.CalResVO;
import com.jwork.progress.service.CalculateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@Api(tags = "计算")
@RestController
@RequestMapping("/cal")
@RequiredArgsConstructor
public class CalculatorController {
    private final CalculateService calculateService;

//    @SystemLog(desc = "策略计算")
    @ApiOperation(value = "获取结果")
    @PostMapping("/getCalRes")
    @ApiResponses({@ApiResponse(code = 200, message = "成功", response = CalResVO.class)})
    public CommonResponse getCalRes(@RequestBody @Validated GetCalResDTO dto) {
        return calculateService.getRes(dto);
    }
}
